package com.ruoyi.books.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.books.mapper.BooksMaterialsMapper;
import com.ruoyi.books.domain.BooksMaterials;
import com.ruoyi.books.service.IBooksMaterialsService;

/**
 * 非遗制作材料Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-28
 */
@Service
public class BooksMaterialsServiceImpl implements IBooksMaterialsService 
{
    @Autowired
    private BooksMaterialsMapper booksMaterialsMapper;

    /**
     * 查询非遗制作材料
     * 
     * @param materialsId 非遗制作材料主键
     * @return 非遗制作材料
     */
    @Override
    public BooksMaterials selectBooksMaterialsByMaterialsId(Long materialsId)
    {
        return booksMaterialsMapper.selectBooksMaterialsByMaterialsId(materialsId);
    }

    /**
     * 查询非遗制作材料列表
     * 
     * @param booksMaterials 非遗制作材料
     * @return 非遗制作材料
     */
    @Override
    public List<BooksMaterials> selectBooksMaterialsList(BooksMaterials booksMaterials)
    {
        return booksMaterialsMapper.selectBooksMaterialsList(booksMaterials);
    }

    /**
     * 新增非遗制作材料
     * 
     * @param booksMaterials 非遗制作材料
     * @return 结果
     */
    @Override
    public int insertBooksMaterials(BooksMaterials booksMaterials)
    {
        return booksMaterialsMapper.insertBooksMaterials(booksMaterials);
    }

    /**
     * 修改非遗制作材料
     * 
     * @param booksMaterials 非遗制作材料
     * @return 结果
     */
    @Override
    public int updateBooksMaterials(BooksMaterials booksMaterials)
    {
        return booksMaterialsMapper.updateBooksMaterials(booksMaterials);
    }

    /**
     * 批量删除非遗制作材料
     * 
     * @param materialsIds 需要删除的非遗制作材料主键
     * @return 结果
     */
    @Override
    public int deleteBooksMaterialsByMaterialsIds(Long[] materialsIds)
    {
        return booksMaterialsMapper.deleteBooksMaterialsByMaterialsIds(materialsIds);
    }

    /**
     * 删除非遗制作材料信息
     * 
     * @param materialsId 非遗制作材料主键
     * @return 结果
     */
    @Override
    public int deleteBooksMaterialsByMaterialsId(Long materialsId)
    {
        return booksMaterialsMapper.deleteBooksMaterialsByMaterialsId(materialsId);
    }
}
